﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AgendaManager.AgendaService;

namespace AgendaManager
{
    public partial class frmObraContacto : Form
    {
        public ObraContacto ObraContacto { get; set; }
        public string NombreContacto { get; set; }
        public string NombreObra { get; set; }

        public frmObraContacto()
        {
            InitializeComponent();
        }

        private void btnGuardar_Click(object sender, EventArgs e)
        {
            ObraContacto.Telefono = txTelefono.Text;
            
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        private void frmObraContacto_Load(object sender, EventArgs e)
        {
            if (ObraContacto == null)
                ObraContacto = new ObraContacto();

            txObra.Text = NombreObra;
            txContacto.Text = NombreContacto;
        }
    }
}
